package com.zcf.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zcf.common.json.Body;
import com.zcf.pojo.Servicese;

import java.util.List;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 客服表 前端控制器
 * </p>
 *
 * @author loupeng
 * @since 2019-03-05
 */
@Controller
@RequestMapping("/servicese")
@CrossOrigin
@ResponseBody
public class ServiceseController {
	/**
	 * 查询客服
	 * 
	 * @return
	 */
	@PostMapping("queryService")
	public Body queryService() {
		Servicese servicese = new Servicese();
		List<Servicese> list = servicese.selectAll();
		if (list.size() > 0) {
			return Body.newInstance(list);
		}
		return Body.BODY_500;
	}

	/**
	 * 修改客服
	 */
	@PostMapping("updateService")
	public Body updateService(Servicese servicese) {
		Boolean falg=servicese.updateById();
		if(falg) {
			return Body.BODY_200;
		}
		return Body.newInstance();
	}
}
